<template>
    <div>
              <div style="margin:40px 0 0 30px;">
                <div style="display:flex;font-size:18px">
                  生产号码展示:
                  <el-switch
                    style="display: block;margin-left: 20px;"
                    v-model="config.show_plan_mobile"
                    :active-value="1"
                    :inactive-value="0"
                    active-color="#2678FF"
                    inactive-color="#CCC"
                  ></el-switch>
                </div>
                <div style="color:#929292;font-size:16px;margin-top:10px">订单已拥有生产号码后会展示给用户</div>
              </div>
              <div style="margin:40px 0 0 30px;">
                <div style="display:flex;font-size:18px">
                  失败原因展示:
                  <el-switch
                    style="display: block;margin-left: 20px;"
                    v-model="config.show_reason"
                    :active-value="1"
                    :inactive-value="0"
                    active-color="#2678FF"
                    inactive-color="#CCC"

                  ></el-switch>
                </div>
                <div style="color:#929292;font-size:16px;margin-top:10px">当开卡失败时会展示失败原因给用户</div>
              </div>
              <div style="margin:40px 0 0 30px;">
                <div style="display:flex;font-size:18px">
                  物流轨迹展示:
                  <el-switch
                    style="display: block;margin-left: 20px;"
                    v-model="config.show_track"
                    :active-value="1"
                    :inactive-value="0"
                    active-color="#2678FF"
                    inactive-color="#CCC"

                  ></el-switch>
                </div>
                <div
                  style="color:#929292;font-size:16px;margin-top:10px"
                >该项为增值服务，开启后您的客户可以查看物流实时轨迹，0.028元/单，同一订单反复查看仅计一次费</div>
              </div>
              <div style="margin:40px 0 0 30px;">
                <div style="display:flex;font-size:18px">
                  订单状态展示:
                  <el-switch
                    style="display: block;margin-left: 20px;"
                    v-model="config.show_status"
                    :active-value="1"
                    :inactive-value="0"
                    active-color="#2678FF"
                    inactive-color="#CCC"
                  ></el-switch>
                </div>
                <div style="color:#929292;font-size:16px;margin-top:10px">会把订单当前的生产状态展示给用户</div>
              </div>
            <el-button style="width:160px;height:40px;margin-top:50px;margin-left:40px;color:white;background:#2974FF;border-radius:30px;border:0" type="primary" round @click="setConfig">保存</el-button>

            </div>
</template>
<script>
export default {
    name: "disposition",
    props:['ruleForm'],
    data() {
        return {
          config: {
            show_plan_mobile: 0,
            show_reason: 0,
            show_track: 0,
            show_status: 0
          }
        }
    },
    watch:{
      ruleForm(val){
        this.config=val
      }
    },
    // mounted() {
    //     this.config=this.ruleForm
    // },
    methods: {
      //获取
        // getConfig() {
        //     this.axios.get(`/api/plan-market/order-page/mini-store/info`).then(res=>{
        //       if(res.data.msg.code == 0){
        //         this.config = res.data.data
        //       }else{
        //         this.$message.error(res.data.msg.info)
        //       }
        //     })
        // },
      //设置
      setConfig: function(val) {
        this.axios
        .post(`/api/plan-market/order-page/mini-store/set`, this.config)
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message.success('设置成功');
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    }
}
</script>
<style scoped>

</style>